package cn.wdm.system.service.impl;

import cn.wdm.basic.service.impl.BaseServiceImpl;
import cn.wdm.system.domain.Dictionary;
import cn.wdm.system.domain.DictionaryDetail;
import cn.wdm.system.mapper.DictionaryDetailMapper;
import cn.wdm.system.mapper.DictionaryMapper;
import cn.wdm.system.service.IDictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DictionaryServiceImpl extends BaseServiceImpl<Dictionary> implements IDictionaryService {
    @Autowired
    private DictionaryMapper mapper;
    @Autowired
    private DictionaryDetailMapper detailMapper;

    @Override
    public List<DictionaryDetail> loadByDictionaryId(Long id) {
        return mapper.loadByDictionaryId(id);
    }
    @Override
    public void removeById(Long id) {
        detailMapper.delByTypeId(id);
        mapper.delete(id);
    }
}
